# -*- coding: utf-8 -*-
import math

class Vector:


    def __init__(self, x, y):
        self.x = x
        self.y = y

    def length(self):
        return math.sqrt(self.lengthSquared())

    def lengthSquared(self):
        return self.x * self.x + self.y * self.y

    def __add__(self, vec2):
        if isinstance(vec2, Vector):
            return Vector(self.x + vec2.x, self.y + vec2.y)
        else:
            return Vector(self.x + vec2, self.y + vec2)

    def __sub__(self, vec2):
        if isinstance(vec2, Vector):
            return Vector(self.x - vec2.x, self.y - vec2.y)
        else:
            return Vector(self.x - vec2, self.y - vec2)

    def __mul__(self, vec2):
        if isinstance(vec2, Vector):
            return self.x * vec2.x + self.y * vec2.y
        else:
            return Vector(self.x * vec2, self.y * vec2)

    def normalize(self):
        length = self.length()
        return Vector(self.x / length, self.y / length)

    def normalizeInPlace(self):
        length = self.length()
        self.x = self.x / length
        self.y = self.y / length

    def get(self):
        return (self.x, self.y)